package Frame;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;
import javax.swing.JDialog;

import Function.FCEventLibrary;

public class FCMapEditEvent extends JDialog {
	public FCMapEditEvent(FCEventLibrary entl, MapEditJpanel mas) {
		setTitle("事件选择");
		setModal(true);
		setBounds(0, 0, 215, 100);
		setLayout(null);
		setLocationRelativeTo(null);
		setResizable(false);

		JComboBox<String> a = new JComboBox<String>();
		a.setBounds(10, 10, 190, 20);
		a.addItem("null");
		for(String n: entl.getEditInMapEvents()){
			a.addItem(n);
		}
		this.add(a);

		JButton ok = new JButton("确认");
		ok.setBounds(10, 40, 190, 20);
		this.add(ok);

		ok.addActionListener(new ActionListener() {
			@Override
			public void actionPerformed(ActionEvent e) {
				mas.setSelectEventName(a.getSelectedItem().toString());
				dispose();
			}
		});

		setVisible(true);
	}
}
